import { IsNotEmpty, IsArray, ArrayNotEmpty, ArrayMaxSize, IsInt } from "class-validator";

/**
 * 分页DTO
 */
export class PagerDto {
	@IsNotEmpty({ message: '页码不能为空'})
    @IsInt({ message: '页码类型为数字' })
	pageIndex: number

	@IsNotEmpty({ message: '每页数量不能为空'})
    @IsInt({ message: '每页数量为数字' })
	pageSize: number
}

/**
 * 批量删除DTO
 */
export class BatchDeleteDto {
    @ArrayNotEmpty({ message: 'list不能为空'})
    @IsArray({ message: '请传入一个list数组' })
    @ArrayMaxSize(50, { message: '批量最大为50条' })
    readonly list: Array<string|number>
}
